package com.dk.service.impl;

import com.dk.mapper.AssessmentMapper;
import com.dk.pojo.TbOnsiteAssessment;
import com.dk.service.AssessmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class AssessmentServiceImpl implements AssessmentService {

    @Autowired
    private AssessmentMapper assessmentMapper;

    @Override
    public List<TbOnsiteAssessment> getAssessmentList() {

        return assessmentMapper.selectList(null);
    }

    @Override
    public TbOnsiteAssessment selectById(Long id) {
        return assessmentMapper.selectById(id);
    }

    @Override
    public void insertAssessment(TbOnsiteAssessment assessment) {
        assessmentMapper.insert(assessment);
    }

    @Override
    public void update(TbOnsiteAssessment assessment) {
        assessmentMapper.updateById(assessment);
    }

    @Override
    public void deleteById(Long id) {
        assessmentMapper.deleteById(id);
    }

    @Override
    public void updateStatusById(TbOnsiteAssessment assessment) {
        assessment.setStatus("1");
        assessmentMapper.updateById(assessment);
    }
}
